﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NATP2P.UPNP;
using System.Net.Sockets;
namespace UPnPController
{
    public partial class Add : Form
    {
        public NATUPNP UPnPHandler { get; set; }

        public Add()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (UPnPHandler.Discovery())
            {
                UPnPHandler.PortForwarding(int.Parse(txtIP.Text), txtIPA.Text, int.Parse(txtEP.Text), radioBtnTCP.Checked ? ProtocolType.Tcp : ProtocolType.Udp, txtD.Text, radioBtnEnabled.Checked ? true : false);
                Close();
            }
            else { MessageBox.Show("can not add UPnP changes"); }
           }

        private void button2_Click(object sender, EventArgs e)
        {
           Close();
        }

       
    }
}
